home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 December / Chip_1999-12_cd.bin / zkuste / MacOS / FILES / CDFIND.SIT / CDFinder 2.7 / Extras / CDFinder & AppleScript next >
Text File  |  1999-10-19  |  6KB  |  91 lines

  1. This document explains some of the details of the current AppleScript implementation
  2. Release: CDFinder 2.7
  3.  
  4. Future versions will include even more support. If you have suggestions, please let me know!
  5.  
  6. ===========================================================
  7.  
  8. The new version 2.7 of CDFInder has an extended AppleScript ability.
  9. You can set all preferences, and of course read the current values.
  10. Below is the dictionary regarding the preferences:
  11.  
  12. Class application: CDFinder's preferences
  13. Properties:
  14.     name  international text  [r/o]  -- the application╒s name
  15.     frontmost  boolean  [r/o]  -- Is CDFinder the frontmost process?
  16.     version  international text  [r/o]  -- the version of CDFinder
  17.     global catalog folder  alias  -- an alias to the main catalog folder
  18.     language  Deutsch/English/Francais/Italian/Swedish/Japanese  -- the language of the user interface
  19.     play sound  boolean  -- should CDFinder play a sound after long operations?
  20.     label1  international text  -- the name of label 1
  21.     label2  international text  -- the name of label 2
  22.     label3  international text  -- the name of label 3
  23.     label4  international text  -- the name of label 4
  24.     label5  international text  -- the name of label 5
  25.     label6  international text  -- the name of label 6
  26.     label7  international text  -- the name of label 7
  27.     main display size  boolean  -- display a column with the size of a volume in the main window
  28.     main display unused  boolean  -- display a column with the unused space of a volume in the main window
  29.     main display label  boolean  -- display a column with the label of a volume in the main window
  30.     main display modification date  boolean  -- display a column with the modification date of a volume in the main window
  31.     main display comment  boolean  -- display a column with the comment of a volume in the main window
  32.     catalog display size  boolean  -- display a column with the size of an item in a catalog window
  33.     catalog display filetype  boolean  -- display a column with the filetype of an item in a catalog window
  34.     catalog display creator  boolean  -- display a column with the creator code of an item in a catalog window
  35.     catalog display modification date  boolean  -- display a column with the modification date of an item in a catalog window
  36.     catalog display creation date  boolean  -- display a column with the creation date of an item in a catalog window
  37.     catalog display label  boolean  -- display a column with the label of an item in a catalog window
  38.     catalog display icons  boolean  -- display the Finder icon of any item in a catalog window (slower!)
  39.     catalog display catalog name  boolean  -- display a column with the catalog name of an item in the found items window
  40.     ignore invisibles  boolean  -- creating a new catalog: ignore invisible files
  41.     ignore icons  boolean  -- creating a new catalog: ignore icons files
  42.     open StuffIt  boolean  -- creating a new catalog: open StuffIt files
  43.     open CompactPro  boolean  -- creating a new catalog: open Compact Pro files
  44.  
  45. ===========================================================
  46.  
  47. It is now also possible to script the Find process. Here is the dictionary:
  48.  
  49. find in: start a new Find operation
  50.     find in  all catalogs/selected catalogs/catalogs without label/catalogs with label 1/catalogs with label 2/catalogs with label 3/catalogs with label 4/catalogs with label 5/catalogs with label 6/catalogs with label 7/found items  -- the selection of catalog files to be searched
  51.         first kind  theName/filetype/creator/size/creation date/modification date/label  -- kind of first value to be found
  52.         [first comparison  fIs/fIsNot/fContains/fContainsNot/fBeginsWith/fEndsWith/fMoreThan/fLessThan/fEarlierThan/fLaterThan]  -- how to compare the value
  53.         first value  reference  -- find String, or filetype, or creator, or size or whatever
  54.         [operator  findAND/findOR]  -- if two find values: how to combine them
  55.         [second kind  theName/filetype/creator/size/creation date/modification date/label]  -- kind of second value to be found
  56.         [second comparison  fIs/fIsNot/fContains/fContainsNot/fBeginsWith/fEndsWith/fMoreThan/fLessThan/fEarlierThan/fLaterThan]  -- how to compare the second value
  57.         [second value  reference]  -- find String, or filetype, or creator, or size or whatever
  58.         [add to found  boolean]  -- add the new results to the already found items, if any
  59.         [start find  boolean]  -- if true, then start find process immediately. If false, just set the values and activate the Find window.
  60.     [Result:   integer]  -- number of found items, or 0 if start find is false
  61.  
  62.  
  63.  
  64. ===========================================================
  65. --  This is a short sample how to tell CDFinder to create catalog files of all local disks
  66. --  By Norbert M. Doerner 1999
  67.  
  68. tell application "Finder"
  69.     set volumeList to every disk as list
  70. end tell
  71.  
  72. tell application "CDFinder"
  73.     repeat with oneDisk in volumeList
  74.         set oneAlias to oneDisk as alias --  CDFinder needs an alias of the disk
  75.         with timeout of 500 seconds --  remember: this might take more than the default 60 seconds!
  76.             set myResult to create catalog of (oneAlias) --  use standard settings and do not update or duplicate
  77.         end timeout
  78.         if myResult = -128 then -- then the catalog might be already there
  79.         end if
  80.     end repeat
  81. end tell
  82.  
  83. --  PLEASE NOTE:
  84. --  If you have any ideas or suggestions or even better, code samples, please tell me!
  85.  
  86. --  Secret commands:
  87. --  By opening the preferences file, CDFinder will open the window to let you change the preferences.
  88. --  By opening any catalog file that is stored inside the catalog folder, CDFinder will open it
  89. --    and display its contents.
  90. --  These secret commands will go away once I figure out how to use properties and the 
  91. --   get/set data commands.